package com.xyht.sca_s.student_manage_system.common.aliyunImg;

import com.xyht.sca_s.student_manage_system.common.aliyunImg.entity.req.CompareFaceReq;
import com.xyht.sca_s.student_manage_system.common.aliyunImg.entity.resp.CompareFaceResp;
import com.xyht.sca_s.student_manage_system.common.aliyunImg.entity.resp.RecognizeFaceResp;
import com.xyht.sca_s.student_manage_system.common.annotation.RequestPass;
import com.xyht.sca_s.student_manage_system.common.commonReturn.CommonResult;
import com.xyht.sca_s.student_manage_system.common.commonReturn.ResponseResult;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@RestController
@RequestMapping("/aliyun/test")
public class AliyunController {

    @PostMapping("/compareFace")
    @RequestPass
    public ResponseResult compareFace(@RequestBody CompareFaceReq compareFaceReq) {
        CompareFaceResp compareFace = AliyunImgUtil.CompareFaceUrl(compareFaceReq.getImgA(), compareFaceReq.getImgB());
        return CommonResult.success(compareFace);
    }
    @PostMapping("/recognizeFace")
    @RequestPass
    public ResponseResult recognizeFace(@RequestBody CompareFaceReq compareFaceReq) {
        RecognizeFaceResp recognizeFace = AliyunImgUtil.recognizeFace(compareFaceReq.getImgA());
        return CommonResult.success(recognizeFace);
    }

}
